﻿using System;
using System.Data;
using Dapper;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Options;
namespace report_yx.Helpers
{
    public class DataContext
    {
        private ConnectionStrings connectionStrings;
        public DataContext(IOptions<ConnectionStrings> options)
        {
            this.connectionStrings = options.Value;
        }

        public IDbConnection DbConnection
        {
            get
            {
                return new SqlConnection(this.connectionStrings.FirstDB);
            }
        }
    }
}

